package com.mf.springboot.backend.userAuth.controller.role;

import com.mf.springboot.backend.commonModule.bean.JSONResult;
import com.mf.springboot.backend.userAuth.service.role.RolesService;
import com.mf.springboot.backend.userAuth.service.role.UserToRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by java_jony on 2017/9/19.
 */
@Controller
@RequestMapping("role")
public class RoleController {

    @Autowired
    private RolesService rolesService;

    @Autowired
    private UserToRoleService userToRoleService;

    @RequestMapping("/test")
    @ResponseBody
    public JSONResult test() {
        JSONResult result = JSONResult.getSuccess();
        Map<String, Object> body = new HashMap();
        body.put("userList",rolesService.getList(null));
        result.setBody(body);
        return result;
    }

}
